<template>
    <div>
        <van-form @submit="onSubmit">
        <van-dialog v-model="show" class="dialog_alert" :message="message" show-confirm-button theme="round-button">
        </van-dialog>
    </van-form>
    </div>
</template>

<script>
import Cookie from "js-cookie";
export default {
    data() {
      return {
        show:false
      }
    },
    methods: {
        onSubmit(values) {
                //获取用户名和密码，同时进行网络请求完成登录验证
                if (values.username == 'aabbcc' && values.password == '123456') {
                    Cookie.set('login', "login");
                    this.$router.replace(this.route);
                } else {
                    this.show = true;
                    this.message = "用户名或密码错误，请重新登录";
                }
            },

  }

  }
</script>

<style scoped lang="less">
   .van-dialog{
    background-color: ;
  }
</style> 